//该文件专门用于创建真个应用的路由器
import Vue from 'vue'
import VueRouter from 'vue-router'
import BookBorrow from '../components/ComponentsofTextBox/TextofBookBorrow.vue'
import BookMsg from '../components/ComponentsofTextBox/TextofBookMsg.vue'
import BookInit from '../components/ComponentsofTextBox/TextofInit.vue'
import BookPlan from '../components/ComponentsofTextBox/TextofReadPlan.vue'

Vue.use(VueRouter)

const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
};

export default new VueRouter({
    mode:'hash',
    routes:[
        {
            name:'borrow',
            path:'/borrow',
            component:BookBorrow
        },
        {
            name:'msg',
            path:'/Msg/:bookMsg',
            component:BookMsg
        },
        {
            name:'init',
            path:'/Init',
            component:BookInit
        },
        {
            name:'readplan',
            path:'/readPlan',
            component:BookPlan
        },
    ]

})
